#include "stdafx.h"

#include "tinyXMLpp.h"
#include "Acceptance.h"

#include <iostream>
#include <cassert>

using namespace tinyXMLpp;

int main(int argc, char** argv)
{	   

	//std::unique_ptr<Document> doc(new Document());	
	///*Document* doc = new Document();*/
	//doc->addChildNode(new CommentNode("This is a comment before the root"));
	/*ElementNode* elem = new ElementNode("Note");*/
	//elem->addAttribute("Id","123");
	//elem->addChildNode(new TextNode("This is a test string"));

	//doc->addChildNode(elem);
	//doc->addChildNode(new CommentNode("This is a comment after the root"));
	//
	//
	//ElementNode* temp = new ElementNode("temp");
	//temp->addAttribute("name","Test");
	//temp->addChildNode(new TextNode("Hello World"));
	//elem->addChildNode(temp);
	//doc->write("output.xml");
	

	std::string file_in = "t.xml", file_out = "tout.xml";

	/*parse an xml document*/
	Parser p;
	std::unique_ptr<Document> doc = p.parse(file_in);	
	
	/*ElementNode *temp = doc->getRootElement();
	temp->addChildNode( TextNode::createTextNode("Dynamicasd\n") );*/

	//*write the dom tree to a file*/
	doc->write( file_out );
	
	

	/*compare*/
	tinyXMLtest::accept_files(file_in,file_out);

	return 0;
}